<%@ page language="java" import="java.util.*, com.zjut.zs.util.tools.*,com.zjut.an.admin.manager.*, com.zjut.an.admin.dao.*,com.zjut.zs.exampage.manager.*, com.zjut.zs.exampage.dao.*,
com.zjut.zs.school.manager.*, com.zjut.zs.school.dao.*, com.zjut.an.config.manager.*, com.zjut.an.config.dao.*,com.zjut.an.util.tools.*,com.zjut.an.util.system.*" pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layui</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" type="text/css" href="../plugins/layuiadmin/layui/css/layui.css" media="all">
	<link rel="stylesheet" type="text/css" href="common/bootstrap/css/bootstrap.css" media="all">
	<link rel="stylesheet" type="text/css" href="common/global.css" media="all">
	<link rel="stylesheet" type="text/css" href="css/personal.css" media="all">
	<script src="js/city.js"></script>
  <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
  <style type="text/css">
  	.layui-form-select dl {
  		z-index:9999;
  	}
  </style>
</head>
<body>
<%
if (session.getAttribute("admin") == null) {
	out.print("<script>alert('由于长时间未操作，系统已经自动注销，请重新登陆');</script>");
	out.print("<script>top.window.location='AdminLogin.html';</script>");
	out.close();
	return;
} 
AnConfigManager anconfig = (AnConfigManager) SpringContextUtil.getBean("AnConfigManager");
HTMLCreat html = (HTMLCreat) SpringContextUtil.getBean("HTMLCreat");
ZsHTMLCreat zhtml = (ZsHTMLCreat) SpringContextUtil.getBean("ZsHTMLCreat");
ZsExamPageManager manager = (ZsExamPageManager) SpringContextUtil.getBean("ZsExamPageManager");
String exType = request.getParameter("exType");

%>
<form class="layui-form" action="">
<div class="layui-form-item">
  	<div class="layui-inline">
	    <label class="layui-form-label">标题</label>
	    <div class="layui-input-block">
	      <input type="text" name="exTitle" lay-verify="exTitle" autocomplete="off" lay-verify="required" placeholder="请输入标题" class="layui-input" value="">
	    </div>
    </div>
    <div class="layui-inline">
	    <label class="layui-form-label">日期</label>
	    <div class="layui-input-block">
	      <input type="text" id="addTime" name="addTime" autocomplete="on" placeholder="" class="layui-input" lay-verify="required" value="">
	    </div>
    </div>
  </div>
  
  
	<div class="layui-form-item">  
		<div class="layui-inline">
        <label class="layui-form-label">内容</label>
        <div class="layui-input-block">
	    <!-- 加载编辑器的容器 -->
	    <script id="container" name="exContent" style="width:1000px" type="text/plain"></script>
	    <!-- 配置文件 -->
	    <script type="text/javascript" src="../plugins/ueditor/ueditor.config.js"></script>
	    <!-- 编辑器源码文件 -->
	    <script type="text/javascript" src="../plugins/ueditor/ueditor.all.js"></script>
	    <!-- 实例化编辑器 -->
	    <script type="text/javascript">
	    var ue = UE.getEditor('container'); 
	    </script>
        </div>  
       </div>
   </div> 
  
		
  <div class="layui-form-item">
    <div class="layui-input-block">
        <input class="form-control" name="scId" type="text" id="scId" value="<%=((ZsSchool)session.getAttribute("school")).getScId() %>" style="display:none"/> 
        <input class="form-control" name="scCode" type="text" id="scCode" value="<%=((ZsSchool)session.getAttribute("school")).getScCode() %>" style="display:none"/> 
        <input class="form-control" name="exType" type="text" id="exType" value="<%=exType%>" style="display:none"/>  
      	<button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
      	<button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
  </div>
</form>
 
          
<script src="../plugins/layuiadmin/layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
	var $;
	layui.use(['jquery'], function(){ 
	   $ = layui.$;
	});
layui.use(['form', 'layedit', 'laydate'], function(){
  var form = layui.form
  ,layer = layui.layer
  ,layedit = layui.layedit
  ,laydate = layui.laydate;
  
  laydate.render({
	  elem: '#addTime' //指定元素
	  ,type: 'datetime'
	  ,value: new Date()
  });
  //监听提交
  form.on('submit(demo1)', function(data){
    var rowStr = data.field;
    $.ajax({
	  	type:"post",
	  	url:"../zsExamPageAdd.action?",
	  	data:{
	  		rowstr:JSON.stringify(rowStr)
	  	},
	  	async:true,
	  	cache:false,
	  	success:function(res){
	  		layer.msg('提交成功')
			setTimeout(function(){
                window.parent.location.reload();//修改成功后刷新父界面
            }, 1000);
	  	}
    });
    return false;
  });
  
});
</script>
</body>
</html>